Skip to content
This repository has been archived by the owner on Apr 21, 2022. It is now read-only.

don't count connections in the grace period against the limit #50

Merged
merged 2 commits into from
Jul 28, 2019

Conversation

Stebalien
Copy link
Member

@Stebalien Stebalien commented Jul 25, 2019

fixes #46

Also, don't count protected connections.

connmgr.go Outdated
@@ -229,12 +230,26 @@ func (cm *BasicConnMgr) getConnsToClose(ctx context.Context) []network.Conn {
// skip over protected peer.
continue
}
if inf.firstSeen.Add(cm.gracePeriod).After(now) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know you only shifted this block from below, but we can precompute the grace threshold only once before entering the loop.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Don't count connections in the grace period
3 participants